package com.jac.alapores.domain;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.persistence.Id;

import com.googlecode.objectify.annotation.Serialized;

public class User
implements Serializable
{	
	private static final long serialVersionUID = 1L;	
	
	@Id
	private String ID;
	@Serialized
	private List<Territory> teritoryList;
	@Serialized
	private List<Alapores> alaporesList;
	@Serialized
	private List<AlaporesHero> alaporesHeroList;
	
	private Date lastRefreshTime;
	private int energyLevel;
	private int gold;
	
	public User() {
		// TODO Auto-generated constructor stub
	}
	
	public User(String userID) {
		ID = userID;
	}
	
	public String getID() {
		return ID;
	}
	public void setID(String pID) {
		ID = pID;
	}
	public List<Territory> getTeritoryList() {
		return teritoryList;
	}
	public void setTeritoryList(List<Territory> pTeritoryList) {
		teritoryList = pTeritoryList;
	}
	public List<Alapores> getAlaporesList() {
		return alaporesList;
	}
	public void setAlaporesList(List<Alapores> pAlaporesList) {
		alaporesList = pAlaporesList;
	}
	public List<AlaporesHero> getAlaporesHeroList() {
		return alaporesHeroList;
	}
	public void setAlaporesHeroList(List<AlaporesHero> pAlaporesHeroList) {
		alaporesHeroList = pAlaporesHeroList;
	}
	public void setLastRefreshTime(Date lastRefreshTime) {
		this.lastRefreshTime = lastRefreshTime;
	}
	public Date getLastRefreshTime() {
		return lastRefreshTime;
	}
	public int getEnergyLevel() {
		return energyLevel;
	}
	public void setEnergyLevel(int pEnergyLevel) {
		energyLevel = pEnergyLevel;
	}
	public int getGold() {
		return gold;
	}
	public void setGold(int pGold) {
		gold = pGold;
	}
	
	public void addTeritory(Territory teritory)
	{
		if (teritoryList == null)
		{
			teritoryList = new ArrayList<Territory>();
		}
		teritoryList.add(teritory);
	}
	
	public void addAlapores(Alapores alapores)
	{
		if (alaporesList == null)
		{
			alaporesList = new ArrayList<Alapores>();
		}
		alaporesList.add(alapores);
	}
	
	public void addHeroAlapores(AlaporesHero alaporesHero)
	{
		if (alaporesHeroList == null)
		{
			alaporesHeroList = new ArrayList<AlaporesHero>();
		}
		alaporesHeroList.add(alaporesHero);
	}
}
